import { IPSWFParallelSubWFProcess } from './ipswfparallel-sub-wfprocess';
import { IPSWFProcessSubWF } from './ipswfprocess-sub-wf';
import { PSWFProcessImpl } from './pswfprocess-impl';

export class PSWFParallelSubWFProcessImpl extends PSWFProcessImpl implements IPSWFParallelSubWFProcess {
  get multiInstMode(): 'NONE' | 'PARALLEL' | 'SEQUENTIAL' {
    return this.M.multiInstMode || 'NONE';
  }

  protected pswfprocesssubwfs: IPSWFProcessSubWF[] | null = null;

  getPSWFProcessSubWFs(): IPSWFProcessSubWF[] | null {
    if (this.pswfprocesssubwfs == null) {
      this.pswfprocesssubwfs = this.fillChildListModel(this.M.getPSWFProcessSubWFs, 'wf.IPSWFProcessSubWF') as IPSWFProcessSubWF[];
    }
    return this.pswfprocesssubwfs;
  }

  get psWFProcessSubWFs(): IPSWFProcessSubWF[] | null {
    return this.getPSWFProcessSubWFs();
  }

  findPSWFProcessSubWF(objKey: any): IPSWFProcessSubWF | null {
    return this.getPSModel5('wf.IPSWFProcessSubWF', this.getPSWFProcessSubWFs(), objKey) as IPSWFProcessSubWF;
  }

  get cls(): string {
    return 'PSWFParallelSubWFProcessImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'wf.IPSWFParallelSubWFProcess') return true;
    return super.instanceof(cls);
  }
}
